//
//  DetailCell.m
//  Ranging_dev
//
//  Created by Mr.Dynasty on 2019/4/1.
//  Copyright © 2019 Mr.Dynasty. All rights reserved.
//

#import "DetailCell.h"

@interface DetailCell ()

@property (strong, nonatomic) UILabel *title;

@property (strong, nonatomic) UILabel *content;

@end

@implementation DetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self makeCell];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)makeCell {
    
    _title = [[UILabel alloc] init];
    _title.font = MediumDefaultFont;
    _title.textColor = TextBlackColor;
    [self addSubview:_title];
    
    _content = [[UILabel alloc] init];
    _content.font = RegularDefaultFont;
    _content.textColor = TextBlackColor;
    _content.numberOfLines = 0;
    [self addSubview:_content];
    
    [_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(self).offset(UIEdgeInsetsMake(15, 10, 0, 10));
        make.height.equalTo(15);
    }];
    
    
    [_content mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self).offset(UIEdgeInsetsMake(0, 10, 20, 10));
        make.height.greaterThanOrEqualTo(0);
        make.top.equalTo(self.title.mas_bottom).offset(20);
    }];
}


- (void)showCell:(NSDictionary *)dataDic {
    self.title.text = dataDic[@"title"];
    self.content.text = dataDic[@"content"];
}

@end
